package com.mallcloud.mall.mall.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.util.Optional;

/**
 * 关联{@link com.mallcloud.mall.mall.api.entity.XglParkingRecordModel}
 */
@ApiModel(value = "ProXglParkingRedeemRecordReporting", description = "停车券兑换记录生成")
@Data
@ToString
public class ProXglParkingRedeemRecordReporting {

	@ApiModelProperty("门店")
	private String storeNo;
	@ApiModelProperty("1查询，2兑换")
	private String type;
	@ApiModelProperty("活动ID")
	private String activityId;
	@ApiModelProperty("手机号码")
	private String phone;
	@ApiModelProperty("卡号")
	private String cardNo;
	@ApiModelProperty("兑换车牌")
	private String plateNo;
	@ApiModelProperty("兑换类型 1免费兑换，2积分兑换, 3优惠券兑换")
	private String redeemType;
	@ApiModelProperty("兑换积分")
	private String redeemPoints;
	@ApiModelProperty("兑换时长(小时)")
	private String redeemDuration;
	@ApiModelProperty("兑换状态 Y已兑换，N未兑换")
	private String redeemStatus;

	@ApiModelProperty("返回id 0-核销成功，1-核销失败")
	private Integer messageId;
	@ApiModelProperty("返回信息")
	private String message;

	public boolean isSuccess() {
		return Optional.ofNullable(this.messageId).map(x -> x.equals(0)).orElse(false);
	}
}
